package homework_09.home_07;

public class HomeWork_07 {
    public static void main(String[] args) {
        /*有一个字符串，其中包含中文字符、英文字符和数字字符，
        请统计和打印出各个字符的个数。*/
        String str = "fsd416123f3s5f防3辐射f53sdfasdgfhfghf4f发斯蒂芬";

        String zz = str.replaceAll("[\\u4e00-\\u9fa5]"
                , "");
        int z = str.length() - zz.length();

        String yy = str.replaceAll("[a-zA-Z]"
                , "");
        int y = str.length()-yy.length();

        String ss = str.replaceAll("[0-9]"
                , "");
        int s = str.length()-ss.length();
        System.out.println("数字有：" + s + "个");
        System.out.println("字母有：" + y + "个");
        System.out.println("汉字有：" + z + "个");
    }
}
